/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package economicocontrol.dao.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author iMac
 */
@Entity
@Table(name = "status_economico")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StatusEconomico.findAll", query = "SELECT s FROM StatusEconomico s"),
    @NamedQuery(name = "StatusEconomico.findByIdStatusEco", query = "SELECT s FROM StatusEconomico s WHERE s.idStatusEco = :idStatusEco"),
    @NamedQuery(name = "StatusEconomico.findByEstadoStatus", query = "SELECT s FROM StatusEconomico s WHERE s.estadoStatus = :estadoStatus"),
    @NamedQuery(name = "StatusEconomico.findByDescripcionStatus", query = "SELECT s FROM StatusEconomico s WHERE s.descripcionStatus = :descripcionStatus")})
public class StatusEconomico implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "Id_StatusEco")
    private String idStatusEco;
    @Basic(optional = false)
    @Column(name = "Estado_Status")
    private String estadoStatus;
    @Column(name = "Descripcion_Status")
    private String descripcionStatus;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "statusEconomicoIdStatusEco")
    private Collection<RegistroEconomicos> registroEconomicosCollection;

    public StatusEconomico() {
    }

    public StatusEconomico(String idStatusEco) {
        this.idStatusEco = idStatusEco;
    }

    public StatusEconomico(String idStatusEco, String estadoStatus) {
        this.idStatusEco = idStatusEco;
        this.estadoStatus = estadoStatus;
    }

    public String getIdStatusEco() {
        return idStatusEco;
    }

    public void setIdStatusEco(String idStatusEco) {
        this.idStatusEco = idStatusEco;
    }

    public String getEstadoStatus() {
        return estadoStatus;
    }

    public void setEstadoStatus(String estadoStatus) {
        this.estadoStatus = estadoStatus;
    }

    public String getDescripcionStatus() {
        return descripcionStatus;
    }

    public void setDescripcionStatus(String descripcionStatus) {
        this.descripcionStatus = descripcionStatus;
    }

    @XmlTransient
    public Collection<RegistroEconomicos> getRegistroEconomicosCollection() {
        return registroEconomicosCollection;
    }

    public void setRegistroEconomicosCollection(Collection<RegistroEconomicos> registroEconomicosCollection) {
        this.registroEconomicosCollection = registroEconomicosCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idStatusEco != null ? idStatusEco.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StatusEconomico)) {
            return false;
        }
        StatusEconomico other = (StatusEconomico) object;
        if ((this.idStatusEco == null && other.idStatusEco != null) || (this.idStatusEco != null && !this.idStatusEco.equals(other.idStatusEco))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "economicocontrol.dao.entity.StatusEconomico[ idStatusEco=" + idStatusEco + " ]";
    }
    
}
